package com.usefullc.crawler.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.usefullc.common.domain.BaseDomain;
import com.usefullc.crawler.domain.Template;
import com.usefullc.system.service.component.extend.ApiField;
import com.usefullc.system.service.component.extend.DictField;
import com.usefullc.system.service.component.extend.EnumField;
import com.usefullc.system.service.component.extend.UsefulField;
import com.usefullc.system.service.component.extend.ApiField;
import com.usefullc.system.validator.UsefulPropertyVerify;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 爬虫模板返回实体
 * @author: 星空
 * @date: 2022-07-26
 */
@Data
public class TemplateVo extends BaseDomain {

//useful_auto_generate_section_start


    @ApiModelProperty(notes = "模板名称")
    private String name;

    @ApiModelProperty(notes = "开启图片")
    private Integer enableImage;

    @ApiModelProperty(notes = "开启脚本")
    private Integer enableJavascript;

    @ApiModelProperty(notes = "开启代理")
    private Integer enableProxy;


    @ApiModelProperty(notes = "数据状态（0 不存在，1 存在）")
    private Boolean delState;


    @ApiModelProperty(notes = "ID")
    private Long id;

    @ApiModelProperty(notes = "切换代理")
    private Integer banSwitchProxy;

    @ApiModelProperty(notes = "开启样式")
    private Integer enableStyle;

    @EnumField(value = "handlerTypeEnum")
    @ApiModelProperty(notes = "处理方式")
    private String handlerType;


    @ApiModelProperty(notes = "随机毫秒")
    private String runRdMs;

    @EnumField(value = "sampleTypeEnum")
    @ApiModelProperty(notes = "抽样类型")
    private Integer sampleType;


    @ApiModelProperty(notes = "抽样数值")
    private Integer sampleValue;

    @ApiModelProperty(notes = "保存页面源码")
    private Integer storePageSource;

    @UsefulField(format = "yyyy-MM-dd")
    @ApiModelProperty(notes = "创建时间")
    private Date gmtCreate;

    @UsefulField(format = "yyyy-MM-dd")
    @ApiModelProperty(notes = "修改时间")
    private Date gmtModified;


    @ApiModelProperty(notes = "描述")
    private String description;

    @ApiModelProperty(notes = "变量")
    private String variables;

//useful_auto_generate_section_end

    @ApiModelProperty(notes = "子集列表")
    private List<ActiveVo> children;

    @ApiModelProperty(notes = "变量配置")
    private String variablesConfig;

    @ApiModelProperty(notes = "预览数据")
    private String previewData;

    @ApiField(url = "/crawler/template/listAll", id = "id", value = "name")
    @ApiModelProperty(notes = "复制模版ID")
    private Long copyTemplateId;

    @ApiModelProperty(notes = "最后运行状态（0 初始化；1 运行中；2 暂停; 3 完成 ）")
    private Integer status;

    @DictField(value = "crawlerTemplateIndustry")
    @ApiModelProperty(notes = "行业")
    private Integer industry;

    @ApiModelProperty(notes = "标签")
    private String tags;

    @ApiModelProperty(notes = "网站域名")
    private String websiteDomain;

    @ApiModelProperty(notes = "图标")
    private String icon;
}
